package trainfengxing.mapper;

import org.apache.ibatis.annotations.*;
import trainfengxing.pojo.user;

import java.util.List;

@Mapper
public interface userMapper {
    @Select("SELECT * FROM users")
    List<user> selectuser();


    @Update("UPDATE users SET `Account` = #{Account},`Password` = #{Password} WHERE `UserID` = #{UserID}")
    void updateuser(user user);

    @Insert("INSERT INTO users(`UserRole`, `Name`, `Gender`, `Age`, `Username`, `Account`, `Password`) " +
            "VALUES(#{userRole}, #{name}, #{gender}, #{age}, #{username}, #{account}, #{password})")
    @Options(useGeneratedKeys = true, keyProperty = "userID")
    void insertUser(user user);

}
